package Arkkomeet

import org.apache.commons.lang.builder.EqualsBuilder
import org.apache.commons.lang.builder.HashCodeBuilder

class PalabraClave implements Serializable {

	String pclavPalabraClave
	Integer minId
	Minuta minuta

	int hashCode() {
		def builder = new HashCodeBuilder()
		builder.append pclavPalabraClave
		builder.append minId
		builder.toHashCode()
	}

	boolean equals(other) {
		if (other == null) return false
		def builder = new EqualsBuilder()
		builder.append pclavPalabraClave, other.pclavPalabraClave
		builder.append minId, other.minId
		builder.isEquals()
	}

	static belongsTo = [Minuta]

	static mapping = {
		id composite: ["pclavPalabraClave", "minId"]
		version false
		table "Palabra_Clave"
	}

	static constraints = {
		pclavPalabraClave maxSize: 30
	}
}
